<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Host extends CI_Controller {

    function Host() {
        parent::__construct();

        $this->load->helper('url');
        $this->load->helper('form');

        $this->load->model('user_model', 'user');
    }

    public function index() {
        if ($this->session->userdata('username')) {

            $data_view["titulo"] = "Hosts";

            $data_view['list'] = $this->host_model->myhosts($this->session->userdata('loginid'));

            $data_view["CI"] = $this;
            $data_view["CI"] = $this;

            $this->template_model->setview('host/index');
            $this->template_model->setviewdata($data_view);

            $this->template_model->load();
        } else {
            redirect("/login");
        }
    }

    public function id() {
        $this->uri->segment(3);
//        echo "ip";
    }

}
